const express = require('express')
const router = express.Router()
const { getUserInfoList, searchUser, setUserMute, banUserAccount, unbanUserAccount } = require('../../controller/apis/UserController')

// 导入JWT拦截中间件
const checkTokenMiddleware = require('../../middleware/checkTokenMiddleware')
// 导入分页中间件
const paginationMiddleware = require('../../middleware/paginationMiddleware');

// 获取用户信息列表
router.get('/user/list', paginationMiddleware, checkTokenMiddleware, getUserInfoList)

// 用户列表搜索功能
router.get('/user/search', checkTokenMiddleware, searchUser)

// 设置用户账号禁言
router.patch('/user/mute/:id', checkTokenMiddleware, setUserMute)

// 封禁用户账号
router.patch('/user/ban/:id', checkTokenMiddleware, banUserAccount)

// 解封用户账号
router.patch('/user/unban/:id', checkTokenMiddleware, unbanUserAccount)

module.exports = router